load("@fbcode_macros//build_defs/lib:rust_oss.bzl", "rust_oss")
load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("mononoke")

rust_library(
    name = "scs_methods",
    srcs = glob(["src/**/*.rs"]),
    crate_root = "src/lib.rs",
    named_deps = {
        "slog": "//common/rust/shed/tracing_slog_compat:tracing_slog_compat",
    } | ({} if rust_oss.is_oss_build() else {
        "MononokeScsRequest_ods3_types": "//eden/mononoke/facebook/ods3_schemas:MononokeScsRequest_ods3-rust",
    }),
    deps = ([
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:async-stream",
        "fbsource//third-party/rust:async-trait",
        "fbsource//third-party/rust:bytes",
        "fbsource//third-party/rust:chrono",
        "fbsource//third-party/rust:faster-hex",
        "fbsource//third-party/rust:futures",
        "fbsource//third-party/rust:futures-util",
        "fbsource//third-party/rust:gix-hash",
        "fbsource//third-party/rust:itertools",
        "fbsource//third-party/rust:maplit",
        "fbsource//third-party/rust:serde_json",
        "fbsource//third-party/rust:tokio",
        "fbsource//third-party/rust:tracing",
        "//common/rust/base_controller:factory_group",
        "//common/rust/oncall:oncall",
        "//common/rust/everstore:everstore_client",
        "//common/rust/identity:identity",
        "//common/rust/shed/borrowed:borrowed",
        "//common/rust/shed/cloned:cloned",
        "//common/rust/shed/fbinit:fbinit",
        "//common/rust/shed/futures_ext:futures_ext",
        "//common/rust/shed/futures_stats:futures_stats",
        "//common/rust/shed/justknobs_stub:justknobs",
        "//common/rust/shed/sorted_vector_map:sorted_vector_map",
        "//common/rust/shed/stats:stats",
        "//common/rust/shed/time_ext:time_ext",
        "//common/rust/shed/futures_retry:futures_retry",
        "//common/rust/srserver:srserver",
        "//configerator/configo/if:configo-rust-srclients",
        "//configerator/structs/common/fbtype:fbtypes-rust",
        "//configerator/structs/scm/mononoke/repos:repos-rust",
        "//eden/mononoke/async_requests:async_requests",
        "//eden/mononoke/blobstore:ephemeral_blobstore",
        "//eden/mononoke/bookmarks:bookmarks",
        "//eden/mononoke/bookmarks:bookmarks_movement",
        "//eden/mononoke/cmdlib/mononoke_app:mononoke_app",
        "//eden/mononoke/commit_cloud/helpers:commit_cloud_helpers",
        "//eden/mononoke/commit_cloud/types:commit_cloud_types",
        "//eden/mononoke/commit_rewriting/synced_commit_mapping:synced_commit_mapping",
        "//eden/mononoke/common/connection_security_checker:connection_security_checker",
        "//eden/mononoke/common/dedupmap:dedupmap",
        "//eden/mononoke/common/futures_watchdog:futures_watchdog",
        "//eden/mononoke/common/memory:memory",
        "//configerator/structs/infrasec/if:acl-rust",
        "//infrasec/authorization/if:if-service-rust-srclients",
        "//infrasec/authorization/if:if-service-rust",
        "//infrasec/authorization/review:review-thrift-rust",
        "//eden/mononoke/common/metadata:metadata",
        "//eden/mononoke/common/scribe_ext:scribe_ext",
        "//eden/mononoke/common/scuba_ext:scuba_ext",
        "//eden/mononoke/derived_data:derived_data_manager",
        "//eden/mononoke/git_source_of_truth:git_source_of_truth",
        "//eden/mononoke/git/git_types:git_types",
        "//eden/mononoke/hooks:hooks",
        "//eden/mononoke/megarepo_api:megarepo_api",
        "//eden/mononoke/megarepo_api:megarepo_config",
        "//eden/mononoke/metaconfig:metaconfig_types",
        "//eden/mononoke/mononoke_api:mononoke_api",
        "//eden/mononoke/mononoke_api_hg:mononoke_api_hg",
        "//eden/mononoke/facebook/diff_service:diff_service_client",
        "//eden/mononoke/facebook/diff_service/if:diff_service_if-rust",
        "//eden/mononoke/facebook/diff_service/if:diff_service_if-rust-clients",
        "//eden/mononoke/cmdlib:environment",
        "//eden/mononoke/mononoke_configs:mononoke_configs",
        "//eden/mononoke/mononoke_macros:mononoke_macros",
        "//eden/mononoke/mononoke_types:mononoke_types",
        "//eden/mononoke/permission_checker:permission_checker",
        "//eden/mononoke/phases:phases",
        "//eden/mononoke/pushrebase:pushrebase",
        "//eden/mononoke/pushrebase_mutation_mapping:pushrebase_mutation_mapping",
        "//eden/mononoke/repo_attributes/repo_identity:repo_identity",
        "//eden/mononoke/repo_authorization:repo_authorization",
        "//eden/mononoke/scs/if:source_control-rust",
        "//eden/mononoke/scs/if:source_control-rust-services",
        "//eden/mononoke/scs/scs_errors:scs_errors",
        "//eden/mononoke/server/context:context",
        "//eden/scm/lib/clientinfo:clientinfo",
        "//crypto/crypto_service/if:crypto-rust-srclients",
        "//eden/mononoke/git_source_of_truth:git_source_of_truth",
        "//login/if:login_objects_thrift-rust",
        "//eden/mononoke/repo_attributes/bonsai_tag_mapping:bonsai_tag_mapping",
        "//eden/mononoke/repo_attributes/repo_blobstore:repo_blobstore",
    ] + ([] if rust_oss.is_oss_build() else [
        "fbsource//third-party/rust:lazy_static",
        "//eden/mononoke/facebook/ods3_schemas:MononokeScsRequest_ods3-rs_bindings",
        "//common/rust/configo:configo",
        "//common/rust/configo:configo_crypto_utils",
    ])),
)
